package com.yt.demo.dao;

import com.yt.demo.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public interface UserDao {

    @Select("select * from user_table where username =#{username}  and password =#{password} ")
    public User login(User user);
    @Select("select * from user_table where username =#{username} ")
    public User getUserByUsername(@Param("username") String username);
    @Select("select * from user_table ")
    public List<User> getUsers();
    @Insert("")
    public int addUser(User u);
}
